package com.qc.controller;

import com.qc.dto.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

@RestController
@RequestMapping("webrtc")
@CrossOrigin
public class WebRTCController {

    // 后续实现视频通话和屏幕共享的信令交互接口
    // 例如：发送Offer，接收Answer，处理Candidate等
    @PostMapping("offer")
    public Result<String> sendOffer(@RequestBody Map<String, Object> offer) {
        // 处理Offer逻辑
        return Result.successResult("Offer已接收");
    }

    @PostMapping("answer")
    public Result<String> receiveAnswer(@RequestBody Map<String, Object> answer) {
        // 处理Answer逻辑
        return Result.successResult("Answer已接收");
    }

    @PostMapping("candidate")
    public Result<String> handleCandidate(@RequestBody Map<String, Object> candidate) {
        // 处理Candidate逻辑
        return Result.successResult("Candidate已接收");
    }
}